$(function(){
	//lianyungangMap("map");
	showRank("map");//连云港土地等级分布图
	/*enterpriseBar("chart1");//企业数量堆叠柱形图
	industryLine("chart2");//产业统计折线图
	enterprisePie("chart3");//企业性质类型饼图
	payTaxLine("chart4");//纳税额企业数量分布
	var timeData = ['1月', '2月', '3月','4月','5月','6月','7月'];
	var timeVal = [220, 310, 325, 245, 182, 265, 142];
	areaChange('inout-export','企业月纳税情况',timeData,timeVal);
	powerUsage("powerUsage");//企业用能月分布*/
	
	ydfx1("ydfx1");//用地分析,柱状图
	ydfx2("ydfx2");//用地分析，饼状图
	projectAnaly1("projectAnaly1");//项目分析，折线图
	projectAnaly2("projectAnaly2");//项目分析，柱状图
	projectAnaly3("projectAnaly3");//项目分析，饼状图
	moneyAnalyst1("moneyAnalyst1");//资金分析，仪表图
	moneyAnalyst2("moneyAnalyst2");//资金分析，漏斗图
	moneyAnalyst3("moneyAnalyst3");//资金分析，折线图
	moneyAnalyst4("moneyAnalyst4");//资金分析，折线图
})

//连云港土地等级分布图
function showRank(id) {
	//城市坐标
    var geoCoordMap = {
        '海州区': [119.128258,34.539596],
        '新浦区': [119.254118,34.630208],
        '连云区': [119.369931,34.707693],
        '赣榆县': [119.000906,34.848309],
        '灌云县': [119.346447,34.389008],
        '东海县': [118.756619,34.551059],
        '灌南县': [119.323485,34.143123]
    };
    var data = [
        /*{name: '海州区', value: 1815},
        {name: '新浦区', value: 1295},
        {name: '连云区', value: 1901},
        {name: '赣榆县', value: 1180},
        {name: '灌云县', value: 470},
        {name: '东海县', value: 760},
        {name: '灌南县', value: 350}*/
        {name: '海州区', value1: 185,value2: 913},
        {name: '新浦区', value1: 125,value2: 811},
        {name: '连云区', value1: 191,value2: 742},
        {name: '赣榆区', value1: 30,value2: 432},
        {name: '灌云县', value1: 70,value2: 454},
        {name: '东海县', value1: 60,value2: 393},
        {name: '灌南县', value1: 50,value2: 324}
    ];
    var rawData = [
		{name:'海州区',value:[185, 413]},
		{name:'新浦区',value:[226, 291]},
	    {name:'连云区',value:[316, 501]},
	    {name:'赣榆区',value:[86, 90]},
	    {name:'灌云县',value:[66, 50]},
	    {name:'东海县',value:[76, 40]},
	    {name:'灌南县',value:[46, 60]}
	];
    var echartWidth = $(window).width() * 0.46;
    var echartHeight = $(window).height() * 0.915;
    //初始化echarts
    var myChart = echarts.init(document.getElementById(id));//在id为mainMap的dom元素中显示地图
    //重置大小
    myChart.resize({
        width: echartWidth,
        height: echartHeight,
    });
    var name = 'lianyungang';
    $.get('./js/mapdata/geometryCouties/320700.json', function(geoJson) {
        echarts.registerMap(name, geoJson);
        var convertData = function (data) {
			var res = [];
			for (var i = 0; i < data.length; i++) {
		        var geoCoord = geoCoordMap[data[i].name];
		        if (geoCoord) {
		            res.push({
		                name: data[i].name,
		                value: geoCoord.concat(data[i].value)
		            });
		        }
		   }
			//console.log(res);
		    return res;
		};
        //点击地图下钻判断
		myChart.on('click',function(params){
	        var flag=false;
	     //alert(params.name);
	     if(params.name=='海州区'){
	         console.log(1);
	     }else if(params.name=='连云区'){
	     	console.log(2);
	     }else if(params.name=='新浦区'){
	     	console.log(3);
	     }else if(params.name=='赣榆区'){
	     	console.log(4);
	     	var str = '<img class="areaMap" src="img/Ganyu.png" alt="" />'
				     	+'<div class="point" title="企业"></div>'
				     	+'<ul class="iconTab">'
    					+'<li><img src="img/icons/green.png" />签约</li>'
    					+'<li><img src="img/icons/orange.png" />在谈</li>'
    					+'<li><img src="img/icons/blue.png" />洽谈</li>'
    					+'<li><img src="img/icons/grey.png" />终止</li>'
    					+'</ul>';
	     	var tip = $(".tip");
	     	$("#map").empty().append(str);
	     	$(".point").append(tip);
	     	/*$("#map").on("click",".point",function(){
	     		$(".content-right").eq(0).hide();
	     		$(".content-right").eq(1).show();
	     	})*/
	     	var $width = $(".content-middle").width();
			var $height = $(".content-middle").height();
		    //第一次加载的时候
		    //根据窗口宽度比例去动态改变提示信息位置
		    $('.point').css({"left": $width * 0.5895, "top": $height * (0.251)});
		    /*$(window).resize(function () {
		        //动态适配页面高度
		        //$('.page1').css({"height": $width * 0.5620});
				var $width = $("body").width();
				var $height = $("body").height();
		        //根据窗口宽度比例去动态改变提示信息位置
		        $('.point').css({"left": $width * 0.215, "top": $height * 0.230});
		    });*/
	     }else if(params.name=='灌云县'){
	     	console.log(5);
	     }else if(params.name=='灌南县'){
	     	console.log(6);
	     }else if(params.name == '东海县'){
	     	console.log(7);
	     }
	    })
        myChart.setOption(option = {
            /*title: {
                text: "连云港土地等级分布",
                left: 'center',
                textStyle: {
                    color: '#fff'
                }
            },*/
            tooltip: {
            	trigger: "item",
            	formatter: function (params){
		            var $pna = params.name;
		            var res = '';
		
		            for(var i = 0;i<data.length;i++){
		                if(data[i].name == $pna){
		                    //res='<div> dddddd</div>'
		                    //res = '<img src="'+ $img[i].url +'" />';//设置自定义数据的模板，这里的模板是图片
		                    res = data[i].name +'<br>商机：'+data[i].value1+'个<br>投资：'+data[i].value2+'亿';
		                    //console.log(res);
		                    break;
		                }
		            }
		            
		            return res;
		
		        }
            },
            /*visualMap: {
                min: 0,
                max: 2000,
                dimension:0,
                left: 'left',
                top: 'bottom',
                text: ['高', '低'], // 文本，默认为数值文本
                textStyle: {
                	color: '#fff'
                },
                calculable: true,
                inRange: {
                    color: ['#3EACE5', '#F02FC2']
                }
            },*/
        	/*geo: {
        		show: true,
		    	map: name,
		    	zoom: 1.25,//地图缩放比例设置
		        
		        //roam: true,
		        //silent: true,
		        itemStyle: {
		        	show: false,
		            normal: {
                        borderColor: '#fff',
                        borderWidth: 1,
                        areaColor: "rgba(0,0,0,0.3)",//地图区域颜色
                    },
                    emphasis: {
                    	label:{
                    		fontWeight: 'bold',
                    		textStyle: {
			                	color:'#fff150'
			                },
                    	},
                        areaColor: "rgba(0,0,0,0.5)",
                        borderColor: 'rgb(255,222,254)',
                        borderWidth: 1,
                    },
		        },
		        
		    },*/
            series: [{
                type: 'map',
                mapType: name,
                zoom: 1.25,//地图缩放比例设置
                //geoIndex: 0,
                itemStyle: {
                    normal: {
                        borderColor: '#fff',
                        borderWidth: 1,
                        areaColor: "rgba(0,0,0,0.3)",//地图区域颜色
                    },
                    emphasis: {
                    	label:{
                    		textStyle: {
			                	color:'#fff150',
			                	fontWeight: 'bold',
			                },
                    	},
                        areaColor: "rgba(0,0,0,0.5)",
                        borderColor: '#337ab7',
                        borderWidth: 2,
                        shadowBlur: 2,
                        shadowColor: '#337ab7'
                    },
                    
                },
                label: {//echarts2.x版本的写法，因为label是属于itemStyle的下级，3.0之后跟它同级
                	show: true,
                	formatter: function (params){
			            var $pna = params.name;//对就区域名称
			            var res = '';
			            for(var i = 0;i<data.length;i++){
			                if(data[i].name == $pna){

			                    if($pna == '连云区' || $pna == '海州区' || $pna == '新浦区'){
			                    	res = '{label|'+ data[i].name +'\n'+data[i].value1+'个,'+data[i].value2+'亿}';
			                    }else{
			                    	res = '{label|'+data[i].name +'\n商机：'+data[i].value1+'个\n投资：'+data[i].value2+'亿}';
			                    }
			                    break;
			                }
			            }
			            
			            return res;
			
			        },
			        
			        lineHeight: 20,//不需要加相素单位，似乎需要配置rich富文本才起作用
	                color:'#fff',
	                rich: {//富文本自定义样式
	                	label: {
	                		align: "left",
	                	}
	                }

                },
                animation: true,
                data: data
            },
            {
	            name: '税收收入量',
	            type: 'scatter',//散点（气泡）图
	            coordinateSystem: 'geo',
	            show: false,
	            data: convertData(rawData),
	            /*tooltip: {
	            	trigger: 'item',
		            formatter: function (params) {
		              if(typeof(params.value)[2] == "undefined"){
		              	return params.name + '<br />金额量 : ' + params.value + ' 万';
		              }else{
		              	return params.name + '<br />金额量 : ' + params.value[2] + ' 万';
		              }
		             
		            }
		        },*/
	            symbolSize: function (val) {
	            	//console.log(val);
	                //return (val[2]+val[3]) / 10;
	            },
	            //show: false,
	            label: {//echarts2.x版本的写法，因为label是属于itemStyle的下级，3.0之后跟它同级
                	show: false,
                	formatter: function (params){
			            var $pna = params.name;//对就区域名称
			            var res = '';
			            for(var i = 0;i<data.length;i++){
			                if(data[i].name == $pna){

			                    if($pna == '连云区' || $pna == '海州区' || $pna == '新浦区'){
			                    	res = '{label|'+ data[i].name +'\n'+data[i].value1+'家,'+data[i].value2+'亿}';
			                    }else{
			                    	res = '{label|'+data[i].name +'\n企业：'+data[i].value1+'家\n产值：'+data[i].value2+'亿}';
			                    }
			                    break;
			                }
			            }
			            
			            return res;
			
			        },
			        
			        lineHeight: 20,//不需要加相素单位，似乎需要配置rich富文本才起作用
	                //color:'#fff',
	                rich: {//富文本自定义样式
	                	label: {
	                		color: '#fff',
	                		align: "left",
	                	}
	                },

                },
                emphasis: {
                	label:{
                		show: true,
                		color: '#fff150',
		                fontWeight: 'bold',
		                rich: {//富文本自定义样式
		                	label: {
		                		color: '#fff150',
		                		fontWeight: 'bold',
		                	}
		                },
                	},
                },
	            /*itemStyle: {
                    normal: {
                        borderColor: '#fff',
                        borderWidth: 1,
                        areaColor: "rgba(0,0,0,0.3)",//地图区域颜色
                    },
                    emphasis: {
                    	label:{
                    		fontWeight: 'bold',
                    		textStyle: {
			                	color:'#fff150'
			                },
                    	},
                        areaColor: "rgba(0,0,0,0.5)",
                        borderColor: 'rgb(255,222,254)',
                        borderWidth: 1,
                    },
                    
                },*/
	        },]
        });
    });
    
}

//企业数量堆叠柱形图
function enterpriseBar(id){
	var echartWidth = $(window).width() * 0.336;
	var echartHeight = $(window).height() * 0.22;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
	    //backgroundColor: '#0E2A43',
	    title: {
            text:'企业数量', 
            top: '1%',
            left: '1%',
            textStyle: {
                color: '#bcbfff',
                fontSize: 14,
                fontWeight: 'bold'
            }
        },
	    legend: {
	        right: '4%',
	        textStyle:{
	            color:'#fff',
	        },
	        data: ['新增企业量', '已有企业数量']
	    },
	    grid: {
	    	top: '15%',
	        left: '3%',
	        right: '4%',
	        bottom: '5%',
	        containLabel: true
	    },
	    
	    tooltip: {
	        show:"true",
	        trigger: 'axis',
	        axisPointer: { // 坐标轴指示器，坐标轴触发有效
	            type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
	        }
	    },
	    xAxis:  [
            {
                type: 'category',
                axisTick : {show: false},
                axisLine: {
                    show: true,
                    lineStyle:{
                        color:'#fff',
                    }
                },
                data: ['1月','2月','3月','4月','5月','6月','7月']
            },
            {
                type: 'category',
                axisLine: {show:false},
                axisTick: {show:false},
                axisLabel: {show:false},
                splitArea: {show:false},
                splitLine: {show:false},
                data: ['1月','2月','3月','4月','5月','6月','7月']
            },
	            
	    ],
	    yAxis: {
	        type: 'value',
	        axisTick : {show: false},
	        axisLine: {
	            show: true,
	            lineStyle:{
	                color:'#fff',
	            }
	        },
	        splitLine: {
	            show: false
	        },
	    },
	    series: [
	        {
	            name: '已有企业数量',
	            type: 'bar',
	            xAxisIndex:1,
	            
	            itemStyle:{
	                normal: {
	                    show: true,
	                    color: '#277ace',
	                    barBorderRadius:40,
	                    borderWidth: 0,
	                    borderColor:'#333',
	                }
	            },
	            barGap:'0%',
	            barCategoryGap:'50%',
	            data: [120, 132, 101, 134, 90, 230, 210]
	        },
	        {
	            name: '新增企业量',
	            type: 'bar',
	            itemStyle:{
	                normal: {
	                    show: true,
	                    color: '#5de3e1',
	                    barBorderRadius:40,
	                    borderWidth: 0,
	                    borderColor:'#333',
	                }
	            },
	            barGap:'0%',
	            barCategoryGap:'50%',
	            data: [32, 52, 41, 64, 15, 110, 32]
	        }
	       
	    ]
	};
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}

//产业统计折线图
function industryLine(id){
	var echartWidth = $(window).width() * 0.336;
	var echartHeight = $(window).height() * 0.22;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
	    //backgroundColor: '#394056',
	    title: {
            text:'产业统计', 
            top: '1%',
            left: '1%',
            textStyle: {
                color: '#bcbfff',
                fontSize: 14,
                fontWeight: 'bold'
            }
        },
	    tooltip: {
	        trigger: 'axis',
	        axisPointer: {
	            lineStyle: {
	                color: '#57617B'
	            }
	        }
	    },
	    legend: {
	        icon: 'rect',
	        itemWidth: 14,
	        itemHeight: 5,
	        itemGap: 13,
	        data: ['第一产业', '第二产业', '第三产业'],
	        right: '4%',
	        textStyle: {
	            fontSize: 12,
	            color: '#F1F1F3'
	        }
	    },
	    grid: {
	    	top: '15%',
	        left: '3%',
	        right: '4%',
	        bottom: '3%',
	        containLabel: true
	    },
	    xAxis: [{
	        type: 'category',
	        boundaryGap: false,
	        axisLine: {
	        	//show: false,
	            lineStyle: {
	                color: '#FFFFFF'
	            }
	        },
	        data: ['1月','2月','3月','4月','5月','6月','7月']
	    }, {
	        axisPointer: {
	            show: false
	        },
	        axisLine: {
	        	//show: false,
	            lineStyle: {
	                color: '#FFFFFF'
	            }
	        },
	        axisTick: {
	            show: false
	        },
	
	        position: 'bottom',
	        offset: 20,
	        data: ['', '', '', '', '', '', '']
	    }],
	    yAxis: [{
	        type: 'value',
	        //name: '单位（%）',
	        axisTick: {
	            show: false
	        },
	        axisLine: {
	        	//show: false,
	            lineStyle: {
	                color: '#FFFFFF'
	            }
	        },
	        axisLabel: {
	            /*margin: 10,
	            textStyle: {
	                fontSize: 14
	            }*/
	        },
	        splitLine: {
	        	show: false,
	            lineStyle: {
	                color: '#FFFFFF'
	            }
	        }
	    }],
	    series: [{
	        name: '第一产业',
	        type: 'line',
	        smooth: true,
	        symbol: 'circle',
	        symbolSize: 5,
	        showSymbol: false,
	        lineStyle: {
	            normal: {
	                width: 1
	            }
	        },
	        areaStyle: {
	            normal: {
	                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
	                    offset: 0,
	                    color: 'rgba(137, 189, 27, 0.6)'
	                }, {
	                    offset: 0.8,
	                    color: 'rgba(137, 189, 27, 0)'
	                }], false),
	                shadowColor: 'rgba(0, 0, 0, 0.3)',
	                shadowBlur: 10
	            }
	        },
	        itemStyle: {
	            normal: {
	                color: 'rgb(137,189,27)',
	                borderColor: 'rgba(137,189,2,0.27)',
	                borderWidth: 12
	
	            }
	        },
	        data: [220, 182, 191, 134, 150, 120, 110]
	    }, {
	        name: '第二产业',
	        type: 'line',
	        smooth: true,
	        symbol: 'circle',
	        symbolSize: 5,
	        showSymbol: false,
	        lineStyle: {
	            normal: {
	                width: 1
	            }
	        },
	        areaStyle: {
	            normal: {
	                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
	                    offset: 0,
	                    color: 'rgba(0, 136, 212, 0.6)'
	                }, {
	                    offset: 0.8,
	                    color: 'rgba(0, 136, 212, 0)'
	                }], false),
	                shadowColor: 'rgba(0, 0, 0, 0.3)',
	                shadowBlur: 10
	            }
	        },
	        itemStyle: {
	            normal: {
	                color: 'rgb(0,136,212)',
	                borderColor: 'rgba(0,136,212,0.2)',
	                borderWidth: 12
	
	            }
	        },
	        data: [120, 110, 125, 145, 122, 165, 122]
	    }, {
	        name: '第三产业',
	        type: 'line',
	        smooth: true,
	        symbol: 'circle',
	        symbolSize: 5,
	        showSymbol: false,
	        lineStyle: {
	            normal: {
	                width: 1
	            }
	        },
	        areaStyle: {
	            normal: {
	                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
	                    offset: 0,
	                    color: 'rgba(219, 50, 51, 0.6)'
	                }, {
	                    offset: 0.8,
	                    color: 'rgba(219, 50, 51, 0)'
	                }], false),
	                shadowColor: 'rgba(0, 0, 0, 0.3)',
	                shadowBlur: 10
	            }
	        },
	        itemStyle: {
	            normal: {
	
	                color: 'rgb(219,50,51)',
	                borderColor: 'rgba(219,50,51,0.2)',
	                borderWidth: 12
	            }
	        },
	        data: [220, 182, 125, 145, 122, 191, 134]
	    }, ]
	};
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}
//企业性质类型饼图
function enterprisePie(id){
	var echartWidth = $(window).width() * 0.336;
	var echartHeight = $(window).height() * 0.22;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
	    title: {
            text:'登记注册类型', 
            top: '1%',
            left: '1%',
            textStyle: {
                color: '#bcbfff',
                fontSize: 14,
                fontWeight: 'bold'
            }
        },
	    tooltip : {
	        trigger: 'item',
	        formatter: "{a} <br/>{b} : {c} ({d}%)"
	    },
	    legend: {
	    	show: false,
	        /*x : 'center',
	        y : 'bottom',
	        textStyle: {
	        	color: '#fff'
	        },
	        data:['当月','上月']*/
	    },
	    color: ['#b6a2de','#5ab1ef','#ffb980','#d87a80','#2ec7c9','#7092be'],
	    calculable : true,
	    series : [
	        {
	            name:'当月',
	            type:'pie',
	            radius : "55%",
	            center : ['25%', '50%'],
	            label: {
		            normal: {
		            	formatter: '{b}\n{d}%',//指示外引显示数据格式
		                textStyle: {
		                    /*color: '#333',*/
		                    fontSize: 12,
		                }
		            }
		        },
		        labelLine: {
		            normal: {
		                show: true//指示外引线段设置
		            }
		        },
	            data:[
	                {value:15, name:'A级'},
	                {value:10, name:'B级'},
	                {value:15, name:'C级'},
	                {value:25, name:'D级'},
	                {value:23, name:'E级'},
	                {value:41, name:'其他'}
	            ]
	        },
	        {
	            name:'上月',
	            type:'pie',
	            radius : "55%",
	            center : ['75%', '50%'],
	            label: {
		            normal: {
		            	formatter: '{b}\n{d}%',//指示外引显示数据格式
		                textStyle: {
		                    /*color: '#333',*/
		                    fontSize: 12,
		                }
		            }
		        },
		        labelLine: {
		            normal: {
		                show: true//指示外引线段设置
		            }
		        },
	            data:[
	                {value:10, name:'A级'},
	                {value:8, name:'B级'},
	                {value:17, name:'C级'},
	                {value:22, name:'D级'},
	                {value:28, name:'E级'},
	                {value:47, name:'其他'}
	            ]
	        }
	    ]
	};

	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}
//纳税额企业数量分布
function payTaxLine(id){
	var echartWidth = $(window).width() * 0.336;
	var echartHeight = $(window).height() * 0.22;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
	    //backgroundColor:'#fff',
	    title: {
            text:'纳税统计', 
            top: '1%',
            left: '1%',
            textStyle: {
                color: '#bcbfff',
                fontSize: 14,
                fontWeight: 'bold'
            }
        },
	    tooltip : {
	        trigger: 'axis',
	        formatter: '纳税额度：{b} <br> 企业数量： {c}家'
	    },
	    legend: {
	    	right: '4%',
	    	textStyle: {
	    		color: '#fff'
	    	},
	        data:['企业数量']
	    },
	     grid: {
	        left: '3%',
	        right: '5%',
	        top:'15%',
	        bottom: '5%',
	        containLabel: true
	    },
	    color:['#fbceb2','#dbb0e3'],
	    calculable : true,
	    xAxis : [
	        {
	            type : 'category',
	            boundaryGap : false,
	            axisLine: {
		        	//show: false,
		            lineStyle: {
		                color: '#FFFFFF'
		            }
		        },
	            data: ['1万','2万','4万','8万','16万','32万','64万','138万','276万','552万','1104万','2208万','4416万','8832万','1亿','2亿',]
	        },
	        
	    ],
	    yAxis : [{
            //name:'投诉立案数',
            type : 'value',
            axisLine: {
	        	//show: false,
	            lineStyle: {
	                color: '#FFFFFF'
	            }
	        },
	        splitLine: {
	        	show: false,
	            lineStyle: {
	                color: '#FFFFFF'
	            }
	        }
    	},
	    ],
	    series : [
	        {
	            name:'企业数量',
	            type:'line',
	            areaStyle: {
	                normal: {type: 'default',
	                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
	                        offset: 0,
	                        color: 'rgba(199, 37, 50,0.2)'
	                    }, {
	                        offset: 1,
	                        color: 'rgba(199, 37, 50,0.8)'
	                    }], false)
	                }
	            },
	            smooth:true,
	            itemStyle: {
	                normal: {areaStyle: {type: 'default'}}    
	            },
	            data:[90, 212, 451,654, 700, 830, 710, 421, 304, 256, 107, 94, 78, 55, 34, 21 ]
	        }
	    ]
	};
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}

function lianyungangMap(id){
	var rawData = [
		{name:'海州区',value:[28, 19]},
		{name:'新浦区',value:[22, 29]},
	    {name:'连云区',value:[31, 90]},
	    {name:'赣榆区',value:[58, 90]},
	    {name:'灌云县',value:[61, 50]},
	    {name:'东海县',value:[77, 40]},
	    {name:'灌南县',value:[43, 60]}
	];
	var namearr = [ '企业数量', '产值'/*, '3', '4','5','6','7','8'*/ ];
	var color1 = {//渐变颜色1
		colorStops: [{
            offset: 0,
            color: '#ffea00' // 0% 处的颜色
        }, {
            offset: 1,
            color: '#ff00c0' // 100% 处的颜色
        }],
    };
    var color2 = {//渐变颜色2
    	colorStops: [{
            offset: 0,
            color: '#00fff6' // 0% 处的颜色
        }, {
            offset: 1,
            color: '#005aff' // 100% 处的颜色
        }],
    };
	var colorarr = [ color1, color2/*, '#01c3dd', '#008198', '#2ef4ab',	'#ffe074', '#ffcbcb', '#cd8425' */];
	//城市坐标
    var geoCoordMap = {
        '海州区': [119.168258,34.539596],
        '新浦区': [119.284118,34.610208],
        '连云区': [119.349931,34.767693],
        '赣榆区': [119.180906,34.848309],
        '灌云县': [119.446447,34.389008],
        '东海县': [118.756619,34.551059],
        '灌南县': [119.323485,34.093123]
    };
    var data = [
        {name: '海州区', value: 95},
        {name: '新浦区', value: 65},
        {name: '连云区', value: 90},
        {name: '赣榆区', value: 80},
        {name: '灌云县', value: 70},
        {name: '东海县', value: 60},
        {name: '灌南县', value: 50}
    ];
    function formtVData(geoData, data, srcNam) {
        var tGeoDt = [];
        for (var i = 0, len = data.length; i < len; i++) {
            var tNam = data[i].name
            if (srcNam != tNam) {
                tGeoDt.push({
                    name: tNam,
                    value: geoData[tNam]
                });
            }

        }
        tGeoDt.push({
            name: srcNam,
            value: geoData[srcNam],
            symbolSize: 8,
            itemStyle: {
                normal: {
                    color: 'red',
                    borderColor: '#000'
                }
            }
        })
        return tGeoDt;
    }
    var echartWidth = $(window).width() * 0.48;
    var echartHeight = $(window).height() * 0.9;
    //初始化echarts
    var myChart = echarts.init(document.getElementById(id));//在id为mainMap的dom元素中显示地图
    //重置大小
    myChart.resize({
        width: echartWidth,
        height: echartHeight,
    });
    //载入青海地图数据
	$.get('./js/mapdata/geometryCouties/320700.json', function (mapJson) {
        echarts.registerMap('320700', mapJson);
        //设置地图上的各项参数
        myChart.setOption({
            /*title : {
                text:"连云港区域企业产值分布图",
                x:'center',
                textStyle: {
                    color: '#fff'
                }
            },*/
            tooltip: {
                trigger: 'axis',//item,axis
                //formatter: "{a} <br/>{b} : {c} ({d}%)"
            },
            /*visualMap: {
                min: 0,
                max: 100000,
                left: 'left',
                top: 'bottom',
                text: ['高', '低'], // 文本，默认为数值文本
                calculable: true,
                color:['lightskyblue','#f2f2f2']
            },*/
            geo: {
            	type: 'map',
                map: '320700',
                label: {
                	normal : {
						textStyle : {
							color : '#fff'
						},
						show : false
					},
                    emphasis: {
                        show: false
                    }
                },
                //silent: true,//定义鼠标在对应区域时是否显示颜色选中
                itemStyle : {
					normal : {
						areaColor : "rgba(0,0,0,0.3)",//地图区域颜色
						borderColor : "#126cc4",
						borderWidth : 1.3
					},
					emphasis : {
						areaColor : "rgba(233,0,200,0.2)"//鼠标悬浮时区域颜色
					}
				}
            },

            series: []
        })

        /*chart.on('click', function (params) {
          var  name = params.name;
            showPie(name);
        });*/
    });
    function renderEachCity() {
		var options = {
			legend:[],
			xAxis : [],
			yAxis : [],
			grid : [],
			series : []
		};
		
		options.legend.push({
	        data : namearr,
	        /*itemWidth:10,
	        itemHeight:10,*/
	        textStyle:{
	            color:'#ddd',
	            fontSize:14
	        },
	       top:'95%',
	        //bottom:'5%'
	    });
	
		echarts.util.each(rawData, function(dataItem, idx) {
			var geoCoord = geoCoordMap[dataItem.name];
			var coord = myChart.convertToPixel('geo', geoCoord);
			idx += '';
			
			options.xAxis.push({
				id : idx,
				gridId : idx,
				type : 'category',
				name : dataItem.name,
				nameStyle : {
					color : '#ddd',
					fontSize : 12
				},
				nameLocation : 'middle',
				nameGap : 3,
				splitLine : {
					show : false
				},
				axisTick : {
					show : false
				},
				axisLabel : {
					show : false
				},
				axisLine : {
					show : false,
					lineStyle : {
						color : '#bbb'
					}
				},
				data : [ dataItem.name ],
			});
			options.yAxis.push({
				id : idx,
				gridId : idx,
				show : false
			});
			options.grid.push({
				id : idx,
				width : 30,
				height : 50,
				left : coord[0] - 15,
				top : coord[1] - 35,
			});
	
			for (var i = 0; i < namearr.length; i++) {
				options.series.push({//循环将每一个区域里的柱形图加入
					name : namearr[i],
					type : 'bar',
					stack : 'bar' + idx,
					xAxisId : idx,
					yAxisId : idx,
					barWidth: 12,
					itemStyle : {
						normal : {
							color : colorarr[i]
						}
					},
					label: {
		                normal: {
		                    show: true,
		                    position: 'inside',
		                    textStyle: {
		                        color: '#fff'
		                    }
		                }
		            },
					data : [ dataItem.value[i] ]
				});
			}
		});
		myChart.on('click',function(params){
	        var flag=false;
	     //alert(params.name);
	     if(params.name=='海州区'){
	         console.log(1);
	     }else if(params.name=='连云区'){
	     	console.log(2);
	     }else if(params.name=='新浦区'){
	     	console.log(3);
	     }else if(params.name=='赣榆县'){
	     	console.log(4);
	     	var str = '<img src="img/Ganyu.png" alt="" /><span class="point" title="企业"></span>';
	     	$("#map").empty().append(str);
	     	$("#map").on("click",".point",function(){
	     		$(".content-right").eq(0).hide();
	     		$(".content-right").eq(1).show();
	     	})
	     }else if(params.name=='灌云县'){
	     	console.log(5);
	     }else if(params.name=='灌南县'){
	     	console.log(6);
	     }else if(params.name == '东海县'){
	     	console.log(7);
	     }
	    })
		myChart.setOption(options);
	}
	setTimeout(function(){
	    renderEachCity();
	},1); 
}

//拆线排名图表
function areaChange(id,title,axisData,valData){
	var echartWidth = $(window).width() * 0.336;
	var echartHeight = $(window).height() * 0.255;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
	    //backgroundColor: '#394056',
	    title: {
	        text: title,
	        textStyle: {
	            /*fontWeight: 'bold',*/
	            fontSize: 14,
	            color: '#fff'
	        },
	        left: '0%',
	        top: '2%'
	    },
	    tooltip: {
	        trigger: 'axis',
	        formatter: '{b}  <br/> {a} : {c}',
	        axisPointer: {
	            lineStyle: {
	                color: '#fff'
	            }
	        }
	    },
	    legend: {
	        icon: 'rect',
	        itemWidth: 14,
	        itemHeight: 5,
	        itemGap: 13,
	        data: [/*'办结',*/ '纳税额'],
	        right: '4%',
	        top: '4%',
	        textStyle: {
	            fontSize: 12,
	            color: '#fff'
	        }
	    },
	    grid: {
	    	top: '30%',
	        left: '2%',
	        right: '5%',
	        bottom: '0%',
	        containLabel: true
	    },
	    xAxis: [{
	        type: 'category',
	        boundaryGap: true,
	        axisLine: {
	            lineStyle: {
	                color: '#fff'
	            }
	        },
	        axisLabel: {
	            textStyle: {
	                color: '#fff',
	                fontSize: 12
	            },
	            //rotate: 40 //设置x轴文字旋转方向
	        },
	        data: axisData
	    }, {
	        axisPointer: {
	            show: false
	        },
	        axisLine: {
	            lineStyle: {
	                color: '#f3f3f3'
	            }
	        },
	        axisTick: {
	            show: false
	        },
	
	        position: 'bottom',
	        offset: 20,
	        /*data: ['', '', '', '', '', '', '',{
	            value: '周六',
	            textStyle: {
	                align: 'left'
	            }
	        }, '周日']*/
	    }],
	    yAxis: [{
	        type: 'value',
	        name: '单位(百万)',
	        axisTick: {
	            show: false
	        },
	        axisLine: {
	            lineStyle: {
	                color: '#fff'
	            }
	        },
	        axisLabel: {
	            margin: 10,
	            textStyle: {
	                fontSize: 12
	            }
	        },
	        splitLine: {//控制y轴的背景线段
	        	show: true,
	        	lineStyle: {
	        		color: '#aaa',
	        		type: 'dashed'
	        	}
	        },
	    }],
	    series: [/*{
	        name: '办结',
	        type: 'line',
	        smooth: true,
	        symbol: 'circle',
	        symbolSize: 5,
	        showSymbol: true,//显示拆线上的圆点
	        lineStyle: {
	            normal: {
	                width: 1
	            }
	        },
	        areaStyle: {
	            normal: {
	                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
	                    offset: 0,
	                    color: 'rgba(137, 189, 27, 0.3)'
	                }, {
	                    offset: 0.8,
	                    color: 'rgba(137, 189, 27, 0.8)'
	                }], false),
	                shadowColor: 'rgba(0, 0, 0, 0.1)',
	                shadowBlur: 10
	            }
	        },
	        itemStyle: {
	            normal: {
	                color: '#ffc72b',
	                borderColor: 'rgba(137,189,2,0.27)',
	                borderWidth: 12
	
	            }
	        },
	        data: [220, 182, 191, 134, 150, 120, 110, 157, 213, 321, 432, 190]
	    },*/ {
	        name: '纳税额',
	        type: 'line',
	        smooth: true,
	        symbol: 'circle',
	        symbolSize: 5,
	        showSymbol: true,//显示拆线上的圆点
	        lineStyle: {
	            normal: {
	                width: 1
	            }
	        },
	        areaStyle: {
	            normal: {
	                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
	                    offset: 0,
	                    color: 'rgba(235,41,125, 0.3)'//起始颜色
	                }, {
	                    offset: 0.8,
	                    color: 'rgba(235,41,125, 0.6)'//结束颜色
	                }], false),
	                shadowColor: 'rgba(0, 0, 0, 0.1)',
	                shadowBlur: 10
	            }
	        },
	        itemStyle: {
	            normal: {
	                color: 'rgba(235,41,125,1)',
	                borderColor: 'rgba(235,41,125,0.2)',
	                borderWidth: 12
	
	            }
	        },
	        data: valData
	    }]
	};
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}
//企业用能月分布情况
function powerUsage(id){
	var echartWidth = $(window).width() * 0.336;
	var echartHeight = $(window).height() * 0.255;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var data = [{
	    "name": "1月",
	    "value": 56.65
	}, {
	    "name": "2月",
	    "value": 87.8
	}, {
	    "name": "3月",
	    "value": 81.3
	}, {
	    "name": "4月",
	    "value": 80
	}, {
	    "name": "5月",
	    "value": 80
	}, {
	    "name": "6月",
	    "value": 80
	}, {
	    "name": "7月",
	    "value": 80
	}];
	var xData = [],
	    yData = [];
	var min = 50; // 最小值的定义
	data.map(function(a, b) {
	    xData.push(a.name);
	    if (a.value === 0) {
	        yData.push(a.value + min);
	    } else {
	        yData.push(a.value);
	    }
	    // yData.push((Math.random(0,1) * 100).toFixed(0));
	});
	var options = {
	    //backgroundColor:"#111c4e",
	    color: ['#3398DB'],
	    title: {
	        text: '企业月用能情况',
	        textStyle: {
	            /*fontWeight: 'bold',*/
	            fontSize: 14,
	            color: '#fff'
	        },
	        left: '0%',
	        top: '2%'
	    },
	    tooltip: {
	        trigger: 'axis',
	        axisPointer: {
	            type: 'line',
	            lineStyle: {
	                opacity: 0
	            }
	        },
	        formatter: function(prams) {
	            if (prams[0].data === min) {
	                return "用电量：0%"
	            } else {
	                return "用电量：" + prams[0].data + "度"
	            }
	        }
	    },
	    legend: {
	        data: ['直接访问', '背景'],
	        show: false
	    },
	    grid: {
	        left: '0%',
	        right: '0%',
	        bottom: '5%',
	        top: '15%',
	        //height: '85%',
	        containLabel: true,
	        z: 22
	    },
	    xAxis: [{
	        type: 'category',
	        gridIndex: 0,
	        data: xData,
	        axisTick: {
	            alignWithLabel: true
	        },
	        axisLine: {
	            lineStyle: {
	                color: '#0c3b71'
	            }
	        },
	        axisLabel: {
	            show: true,
	             color: 'rgb(170,170,170)',
	             fontSize: 12
	        }
	    }],
	    yAxis: [{
	            type: 'value',
	            gridIndex: 0,
	            splitLine: {
	                show: false
	            },
	            axisTick: {
	                show: false
	            },
	            min: min,
	            max: 100,
	            axisLine: {
	                lineStyle: {
	                    color: '#0c3b71'
	                }
	            },
	            axisLabel: {
	                color: 'rgb(170,170,170)',
	                formatter: '{value} %'
	            }
	        },
	        {
	            type: 'value',
	            gridIndex: 0,
	            min: min,
	            max: 100,
	            splitNumber: 12,
	            splitLine: {
	                show: false
	            },
	            axisLine: {
	                show: false
	            },
	            axisTick: {
	                show: false
	            },
	            axisLabel: {
	                show: false
	            },
	            splitArea: {
	                show: true,
	                areaStyle: {
	                    color: ['rgba(250,250,250,0.0)', 'rgba(250,250,250,0.05)']
	                }
	            }
	        }
	    ],
	    series: [{
	            name: '合格率',
	            type: 'bar',
	            barWidth: '30%',
	            xAxisIndex: 0,
	            yAxisIndex: 0,
	            itemStyle: {
	                normal: {
	                    barBorderRadius: [30, 30, 0, 0],
	                    color: new echarts.graphic.LinearGradient(
	                        0, 0, 0, 1, [{
	                                offset: 0,
	                                color: '#00feff'
	                            },
	                            {
	                                offset: 0.5,
	                                color: '#027eff'
	                            },
	                            {
	                                offset: 1,
	                                color: '#0286ff'
	                            }
	                        ]
	                    )
	                }
	            },
	            data: yData,
	            zlevel: 11
	
	        },
	        {
	            name: '背景',
	            type: 'bar',
	            barWidth: '50%',
	            xAxisIndex: 0,
	            yAxisIndex: 1,
	            barGap: '-135%',
	            data: [100, 100, 100, 100, 100, 100, 100],
	            itemStyle: {
	                normal: {
	                    color: 'rgba(255,255,255,0.1)'
	                }
	            },
	            zlevel: 9
	        },
	      
	    ]
	};
	

	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}
//用地分析
function ydfx1(id){
	var echartWidth = $(window).width() * 0.200;
	var echartHeight = $(window).height() * 0.180;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
	    color: ["#ed4743", "#54ba9b", "#f48b38", "#35acfe"],
	 	tooltip: {
	 		trigger: 'axis',
	 		axisPointer: { // 坐标轴指示器，坐标轴触发有效
	 			type: 'shadow' // 默认为直线，可选为：'line' | 'shadow'
	 		}
	 	},
	 	grid:{
	 		x:45,
	 		y:10,
	 		y2:40
	 	},
	 	legend: {
//	 		x: '6%',
	 		y: 'bottom',
	 		itemWidth:10,
	 		itemHeight:10, 
	 		textStyle: {
	 			color: '#fff'
	 		},
	 		data: ['高新技术', '三产', '二产', '一产']
	 	},
	 	yAxis: [{
	 		type: 'value',
	 		axisLine: {
	 			lineStyle: {
	 				color: '#35acfe'
	 			}
	 		},
	 		splitLine: {
				show: false
			},
	 	}],
	 	xAxis: [{
	 		type: 'category',
	 		axisLine: {
	 			lineStyle: {
	 				color: '#35acfe'
	 			}
	 		},
	 		data: ['<100亩', '100~200亩', '200~500亩', '>500亩']
	 	}],
	 	series: [{
	 			name: '高新技术',
	 			type: 'bar',
	 			stack: '总量',
	 			itemStyle: {
	 				normal: {
	 					label: {
	 						show: false,
	 						position: 'insideRight'
	 					}
	 				}
	 			},
	 			data: [20, 32, 31, 34],
	 			barWidth: "25",
	 		},
	 		{
	 			name: '三产',
	 			type: 'bar',
	 			stack: '总量',
	 			itemStyle: {
	 				normal: {
	 					label: {
	 						show: false,
	 						position: 'insideRight'
	 					}
	 				}
	 			},
	 			data: [20, 12, 11, 14],
	 			barWidth: "25",
	 		},
	 		{
	 			name: '二产',
	 			type: 'bar',
	 			stack: '总量',
	 			itemStyle: {
	 				normal: {
	 					label: {
	 						show: false,
	 						position: 'insideRight'
	 					}
	 				}
	 			},
	 			data: [22, 18, 19, 24],
	 			barWidth: "25",
	 		},
	 		{
	 			name: '一产',
	 			type: 'bar',
	 			stack: '总量',
	 			itemStyle: {
	 				normal: {
	 					label: {
	 						show: false,
	 						position: 'insideRight'
	 					}
	 				}
	 			},
	 			data: [15, 22, 21, 15],
	 			barWidth: "25",
	 		}
	 	]
	};
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}

function ydfx2(id){
	var echartWidth = $(window).width() * 0.135;
	var echartHeight = $(window).height() * 0.180;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
		color: ["#ed4743", "#54ba9b", "#f48b38", "#35acfe"],
		tooltip: {
			trigger: 'item',
			formatter: "{a} <br/>{b} : {c} ({d}%)"
		},
		legend: {
			orient: "vertical",
			y:20,
			right: '1%',
			itemWidth: 10,
			itemHeight: 5,
			itemGap: 5,
			textStyle: {
				color: '#fff',
				fontSize: 12
			},
			data: ['<100亩', '100~200亩', '200~500亩', '>500亩']
		},
		series: [{
			name: '用地分析',
			type: 'pie',
			radius: '65%',
			center: ['25%', '50%'],
			itemStyle: {
				normal: {
					label: {
						show: true,
						position: 'inner',
						textStyle: {
							fontSize: '8'
						},
						formatter: "{d}%"
					}
				}
			},
			data: [{
					value: 335,
					name: '<100亩'
				},
				{
					value: 310,
					name: '100~200亩'
				},
				{
					value: 235,
					name: '200~500亩'
				},
				{
					value: 135,
					name: '>500亩'
				}
			]
		}]
	}
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}

function projectAnaly1(id){
	var echartWidth = $(window).width() * 0.336;
	var echartHeight = $(window).height() * 0.135;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var legend = ['新增项目', '签约项目'];
	var xAxisData = ['1月', '2月', '3月', '4月', '5月', '6月', '7月'];
	var data1 = [11, 14, 15, 13, 15, 13, 14];
	var data2 = [7, 9, 11, 10, 13, 12, 10];
	var options = {
//		color: ["#ed4743", "#54ba9b", "#f48b38", "#35acfe"],
		tooltip: {
			trigger: 'axis'
		},
		color: ['#4c8caa', '#f19738'],
		grid:{
			top: '10%',
			left: '8%',
			right: '8%',
			bottom: '40%'
		},
		legend: {
			data: legend,
			bottom: 5,
			textStyle: {
				color: '#fff'
			}
		},
		xAxis: [{
			type: 'category',
			boundaryGap: false,
			axisLine: {
				lineStyle: {
					color: '#35acfe'
				}
			},
			data: xAxisData
		}],
		yAxis: [{
			type: 'value',
			max: 20,
			axisLine: {
				lineStyle: {
					color: '#35acfe'
				}
			},
			splitLine: {
				show: false
			}
		}],
		series: [{
				name: '新增项目',
				type: 'line',
				symbol: 'rect',
				data: data1
			},
			{
				name: '签约项目',
				type: 'line',
				symbol: 'diamond',
				data: data2
			}
		]
	}
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}

function projectAnaly2(id){
	var echartWidth = $(window).width() * 0.226;
	var echartHeight = $(window).height() * 0.135;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var xAxisData = ['一产项目', '二产项目', '三产项目', '高新科技'];
	var options = {
		tooltip: {
			trigger: 'axis'
		},
		color: ["#348ea9", "#54ba9b", "#f48b38", "#35acfe"],
		grid:{
			x:40,
			y:1,
//			x2:20,
			y2:30
		},
		xAxis: [{
			type: 'category',
			axisLine: {
				lineStyle: {
					color: '#35acfe'
				}
			},
			data: xAxisData
		}],
		yAxis: [{
			type: 'value',
			max: 30,
			axisLine: {
				lineStyle: {
					color: '#35acfe'
				}
			},
			splitLine: {
				show: false
			}
		}],
		series: [{
			type: 'bar',
			barWidth: 25,
			data: [{
					value: '12.0',
					itemStyle: {
						color: '#348ea9'
					},
					//barWidth:30
				},
				{
					value: '24.9',
					itemStyle: {
						color: '#54ba9b'
					},
					//barWidth:30
				},
				{
					value: '27.0',
					itemStyle: {
						color: '#f48b38'
					},
					//barWidth:30
				},
				{
					value: '23.2',
					itemStyle: {
						color: '#35acfe'
					},
					//barWidth:30
				}
			]
		}]
	}
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}

function projectAnaly3(id){
	var echartWidth = $(window).width() * 0.100;
	var echartHeight = $(window).height() * 0.125;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
		color: ["#ed4743", "#54ba9b", "#f48b38", "#35acfe"],
		series: [{
			type: 'pie',
			radius: ['22', '38'],
			grid:{
				x:0,
				y:0,
			},
			itemStyle: {
				normal: { //正常时样式
					label: {
						show: true,
						position: 'inner',
						textStyle: {
							fontSize: '10'
						}
					},
					labelLine: {
						show: true
					}
				},
				emphasis: { //鼠标停留时样式

				}
			},
			data: [{
					value: 335,
					name: '股份'
				},
				{
					value: 310,
					name: '合资'
				},
				{
					value: 234,
					name: '国有'
				}
			]
		}]
	}
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}

function moneyAnalyst1(id){
	var echartWidth = $(window).width() * 0.107;
	var echartHeight = $(window).height() * 0.155;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
		color: ["#ed4743", "#54ba9b", "#f48b38", "#35acfe"],
		title: {
			text: '17.7亿（本年度累积完成）',
			y: 'top',
			x: 'center',
			textStyle: {
				fontSize: 5,
				fontWeight: 'thiner',
				color: '#fff'
			}
		},
		series: [{
			name: '业务指标',
			type: 'gauge',
			center:['50%', '70%'],
			radius:"100%",
			startAngle:180,
			endAngle:0,
			min:70,
			max:160,
			pointer:{
			    length : '90%',
			    width : 2,
			},
			detail: {
				show:true,
				formatter: '内资注册资本',
				color: '#fff',
		        fontSize : 10
			},
			axisLine:{
				show: true,
	            lineStyle: {
	                width: 3,//控制颜色区域外围大小
	                shadowBlur: 0,
	                color: [
	                    [0.3, '#67e0e3'],
	                    [0.7, '#37a2da'],
	                    [1, '#fd666d']
	                ]
	            }
			},
			splitLine:{
				show: true,
				length: 10,         // 属性length控制线长
                lineStyle: {       // 属性lineStyle（详见lineStyle）控制线条样式
                    color: 'auto'
                }
			},
			axisTick:{
				show: false,
			},
			axisLabel:{
				show: false,
			},
			itemStyle: {
				normal: {
				   	color: '#fff'
				},
			},
			data: [{
				value: 80
			}]
		}]
	}
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}

function moneyAnalyst2(id){
	var echartWidth = $(window).width() * 0.102;
	var echartHeight = $(window).height() * 0.15;
	//var echartWidth = 160;
	//var echartHeight = 70;
	
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
		color: ["#348ea9", "#54ba9b", "#f48b38", "#35acfe"],
		title: {
			text: '合同外资(亿美元)',
			y: 'bottom',
			x: 'center',
			textStyle: {
				fontSize: 12,
				fontWeight: 'thiner',
				color: '#fff'
			}
		},
		series: [{
				name: '预期',
				type: 'funnel',
				left: '5%',
				top: '5%',
				bottom: '15%',//grid对于漏斗图没有效果
				width: '70%',
				maxSize: '60%',
				itemStyle: {
					normal: {
						label: {
							formatter: '{b}预期'
						},
						labelLine: {
							show: false
						}
					},
					emphasis: {
						label: {
							position: 'inside',
							formatter: '{b}预期 : {c}%'
						}
					}
				},
				data: [{
						value: 60,
						name: '访问'
					},
					{
						value: 40,
						name: '咨询'
					},
					{
						value: 20,
						name: '订单'
					},
					{
						value: 80,
						name: '点击'
					},
					{
						value: 100,
						name: '展现'
					}
				]
			},
			{
				name: '实际',
				type: 'funnel',
				left: '5%',
				top: '5%',
				bottom: '15%',
				width: '70%',
				maxSize: '60%',
				itemStyle: {
					normal: {
						borderColor: '#fff',
						borderWidth: 1,
						label: {
							position: 'inside',
							formatter: '{c}%',
							textStyle: {
								color: '#fff',
								fontSize: 10
							}
						}
					},
					emphasis: {
						label: {
							position: 'inside',
							formatter: '{b}实际 : {c}%'
						}
					}
				},
				data: [{
						value: 30,
						name: '访问'
					},
					{
						value: 10,
						name: '咨询'
					},
					{
						value: 5,
						name: '订单'
					},
					{
						value: 50,
						name: '点击'
					},
					{
						value: 80,
						name: '展现'
					}
				]
			}
		]
	}
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}
//资金分析饼图
function moneyAnalyst3(id){
	var echartWidth = $(window).width() * 0.107;
	var echartHeight = $(window).height() * 0.155;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
		title: {
			text: '实到外资(亿美元)',
			y: 'bottom',
			x: 'center',
			textStyle: {
				fontSize: 12,
				fontWeight: 'thiner',
				color: '#fff'
			}
		},
		color: ["#ed4743", "#54ba9b", "#f48b38", "#35acfe"],
		series: [{
			type: 'pie',
			radius: ['50%', '60%'],
			center: ['50%', '40%'],
			roseType: 'radius',
			grid:{
				x:0,
				y:0,
			},
			itemStyle: {
				normal: { //正常时样式
					label: {
						show: true,
						/*position: 'inner',*/
						textStyle: {
							fontSize: '10'
						}
					},
					labelLine: {
						show: false,
						length: 1,//文字到饼图的距离
						length2: 1//文字到饼图的距离
					}
				},
				emphasis: { //鼠标停留时样式

				}
			},
			data: [{
					value: 335,
					name: '完成率'
				},
				{
					value: 310,
					name: '年度指标'
				},
				{
					value: 234,
					name: '年度累积'
				}
				,
				{
					value: 134,
					name: ''
				}
			]
		}]
	}
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}

function moneyAnalyst4(id){
	var echartWidth = $(window).width() * 0.335;
	var echartHeight = $(window).height() * 0.195;
	// 基于准备好的dom，初始化echarts实例
	var myChart = echarts.init(document.getElementById(id));
	/*根据浏览器宽、高设置echarts 宽、高*/
	myChart.resize({
	    width: echartWidth,
	    height: echartHeight,
	});
	/*end*/
	var options = {
		color: ["#348ea9", "#54ba9b", "#f48b38", "#35acfe"],
		tooltip: {
			trigger: 'axis',
			axisPointer: {
				type: 'cross'
			}
		},
		grid:{
			x:40,
			y:10,
			y2:45
		},
		legend: {
			bottom: 5,
			textStyle: {
				color: '#fff',
				fontSize: 12
			},
			data: ['内资注册资本', '合同外资', '实到外资']
		},
		xAxis: [{
			type: 'category',
			axisTick: {
				alignWithLabel: true
			},
			axisLine: {
				lineStyle: {
					color: '#35acfe'
				}
			},
			axisLabel: { //轴坐标标识样式
				textStyle: {
					color: '#fff',
					fontSize: 12
				},
			},
			data: ['1月', '1-2月', '1-3月', '1-4月', '1-5月', '1-6月', '1-7月', '1-8月', '1-9月', '1-10月', '1-11月', '1-12月']
		}],
		yAxis: [{
				type: 'value',
				min: 0,
				max: 50,
				position: 'left',
				axisLine: {
					lineStyle: {
						color: '#35acfe'
					}
				},
				axisLabel: { //轴坐标标识样式
					textStyle: {
						color: '#fff',
						fontSize: 12
					},
					formatter: '{value} '
				},
				splitLine: {
					show: false
				}
			},
			{
				type: 'value',
				min: 0,
				max: 50,
				position: 'right',
				axisLine: {
					lineStyle: {
						color: '#35acfe'
					}
				},
				axisLabel: { //轴坐标标识样式
					textStyle: {
						color: '#fff',
						fontSize: 12
					},
					formatter: '{value}'
				},
				splitLine: {
					show: false
				}
			}
		],
		series: [{
				name: '内资注册资本',
				type: 'line',
				symbol: "triangle",
				yAxisIndex: 1,
				data: [2.6, 5.9, 9.0, 16.4, 18.7, 20.7, 25.6, 32.2,38.7, 38.8, 46.0, 48.7]
			},
			{
				name: '合同外资',
				type: 'line',
				symbol: "diamond",
				yAxisIndex: 1,
				data: [1.0, 4.9, 7.0, 13.2, 15.6, 16.7, 25.6, 22.2, 26.6, 28.0, 30.4, 35.3]
			},
			{
				name: '实到外资',
				type: 'line',
				symbol: "rect",
				yAxisIndex: 1,
				data: [1.9, 5.2, 8.3, 11.5, 13.3, 16.2, 20.3, 23.4, 25.0, 26.5, 30.0, 31.3]
			}
		]
	}
	// 使用刚指定的配置项和数据显示图表。
	myChart.setOption(options);
}